import pytest
from datetime import datetime
from zhoukao.Week3.Page import Page
from selenium.webdriver.common.by import By
from selenium import webdriver
from time import sleep
@pytest.fixture
class Test_Testrun:
    def driver(self):
        self.driver = webdriver.Edge()
        #放大
        self.driver.maximize_window()
        yield self.driver
        self.driver.quit()

    def test_testrun(self,driver):
        try:
            po = Page(driver)
            po.test_01_A3mall()
            time = datetime.now().strftime('%Y%m%d_%H%M%S')
            jietu = self.driver.execute(f'phot_{time}.png')
        except Exception as e:
            print(e)